<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>博朗思信息管理系统</title>
<link href="/Public/admin/css/style.css" rel="stylesheet">
<link href="/Public/admin/css/index.css" rel="stylesheet">
<link href="/Public/admin/css/font-awesome.min.css" rel="stylesheet">
<style>
.childActive{
	background:url(/Public/admin/images/childMen.png) no-repeat top right;
	color:#fff;
}
</style>
</head>
<body>
	<nav class="navbar">
		
		<div class="nav-right">
			<span><i class="icon-user"></i>&nbsp;系统管理员：{$AdminName}</span>
			<div style="margin-top:-70px">
				<a href="javascript:;" onClick="changePwd()"><span><i class="icon-lock"></i>&nbsp;修改密码</span></a>&nbsp;&nbsp;丨&nbsp;
				<a href="/Admin/Index/logout"><span><i class="icon-off"></i>&nbsp;退出</span></a>
			</div>
		</div>
	</nav>
	<nav class="nav-menu">
		<ul id="firstMenu">
			
		</ul>
	</nav>
	<div id="panel">
		<div id="panel-left">
			
		</div>
		<div id="panel-right">
			<iframe src="/Admin/Index/main" id="iframe" width="100%" height="100%" frameborder="0"></iframe>
		</div>
	</div>
	<div id="changePwdBox" style="display:none; padding:15px;">
			<div class="form-group">
				<label class="control-label">新密码:</label>
				<input type="password" name="pwds" id="pwds" class="form-control" autocomplete="off">
			</div>
			<div class="form-group">
				<label class="control-label">再次输入:</label>
				<input type="password" name="pwdAgain" id="pwdAgain" class="form-control" autocomplete="off">
			</div>
			<div class="form-group">
				<button class="btn btn-primary subBtn" onClick="passUpdate();">保存</button>
			</div>
	</div>
	
</body>
<script src="/Public/js/jquery.min.js?ver=1.8.3"></script>
<script src="/Public/admin/js/menu.js"></script>
<script src="/Public/plugin/layer/layer.js"></script>
<script src="/Public/js/vali.js"></script>
<script>
	window.alert = function(msg){
		layer.alert(msg);
	};
	var w;
	$(function(){
		$.drawMenu({"url":"/Admin/Index/getMenu"});
		$("form").vali({
			"control":[
				{"id":"pwds","rule":"notNull","errorText":""},
				{"id":"pwdAgain","rule":"notNull","errorText":""}
			]	
		});
		$("#pwds").val("");
	})
	//隐藏
	function showHide(dom1,dom2){
		$(dom1).show();
		$.each(dom2,function(k,d){
			$(d).hide();
		})		
	}
	
	function changePwd(){
		var w=layer.open({
			type: 1,
			title: ['修改密码', 'font-size:16px;'],
			skin: 'layui-layer-rim', //加上边框
			area: ['420px', '240px'], //宽高
			content: $("#changePwdBox")
		});
		$(".subBtn").on("click",function(){
			if($("#pwds").val()!=$("#pwdAgain").val()){
				alert("两次输入不一致，请更改后提交。")
				return false;
			}
			var userPass=$("#pwds").val();
			$.post('/Admin/Main/passUpdate',{userPass:userPass},function(data){
				if(data==1){
					alert('修改成功');
				}else{
					alert('修改失败');
				}
				layer.close(w);
			});
		})
	}
</script>
</html>
